home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Subtraction / card_7737.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  11.3 KB  |  493 lines

  1. -- card: 7737 from stack: in
  2. -- bmap block id: 6422
  3. -- flags: 0000
  4. -- background id: 7635
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 0001
  11. -- rect: left=256 top=229 right=320 bottom=352
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Smiley
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: 0001
  25. -- rect: left=251 top=87 right=180 bottom=351
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Frowney
  34.  
  35.  
  36. -- part 3 (button)
  37. -- low flags: 00
  38. -- high flags: 8003
  39. -- rect: left=354 top=102 right=139 bottom=468
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 1
  43. -- font id: 0
  44. -- text size: 12
  45. -- style flags: 0
  46. -- line height: 16
  47. -- part name: Next Problem
  48. ----- HyperTalk script -----
  49. on mouseUp
  50.   if field "Flag" = 0 then exit mouseUp
  51.   show button "Smiley"
  52.   show button "Frowney"
  53.   put empty into field "Comment"
  54.   put "   " into field "Minuend"
  55.   put "   " into field "Subtrahend"
  56.   put "   " into field "Difference"
  57.   put "   " into num1
  58.   put "   " into num2
  59.   put "   " into num3
  60.   if field "Attempts" = second word of bkgnd field "Options" then
  61.     put field "Attempts" into attempts
  62.     put field "Correct" into correct
  63.     put field "Percent" into percent
  64.     put field "Name" into name
  65.     put third word of field "Options" into skill
  66.     put "O" into field "Attempts"
  67.     put "O" into field "Correct"
  68.     put "O" into field "Percent"
  69.     set the lockScreen to true
  70.     set the cursor to 4
  71.     go to first card of bkgnd "Users"
  72.     rotateData
  73.     put name into line 1 of field "name"
  74.     put the date into line 1 of field "Date"
  75.     put skill into line 1 of field "Skill"
  76.     put attempts into line 1 of field "Attempts"
  77.     put correct into line 1 of field "Correct"
  78.     put percent into line 1 of field "Percent"
  79.     pop card
  80.     exit mouseUp
  81.   end if
  82.   get the random of 800
  83.   add 99 to it
  84.   put it into num1
  85.   put 9 into it
  86.   subtract third char of num1 from it
  87.   get the random of it
  88.   subtract 1 from it
  89.   put it into third char of num2
  90.   put 9 into it
  91.   subtract second char of num1 from it
  92.   get the random of it
  93.   subtract 1 from it
  94.   put it into second char of num2
  95.   put 8 into it
  96.   subtract first char of num1 from it
  97.   if it >0 then get the random of it else put 1 into it
  98.   put it into first char of num2
  99.   put num1 into num3
  100.   add num2 to num3
  101.   put num3 into field "Minuend"
  102.   put num2 into field "Subtrahend"
  103.   put "   " into field "Difference"
  104.   put "0" into field "Flag"
  105.   put "?" into char 3 of field "Difference"
  106. end mouseUp
  107.  
  108. on rotateData
  109.   repeat with x = 11 down to 1
  110.     if line x of field "Name" is empty then next repeat
  111.     put x into nextLine
  112.     add 1 to nextLine
  113.     get line x of field "Name"
  114.     put it into line nextLine of field "Name"
  115.     get line x of field "Date"
  116.     put it into line nextLine of field "Date"
  117.     get line x of field "Skill"
  118.     put it into line nextLine of field "Skill"
  119.     get line x of field "Attempts"
  120.     put it into line nextLine of field "Attempts"
  121.     get line x of field "Correct"
  122.     put it into line nextLine of field "Correct"
  123.     get line x of field "Percent"
  124.     put it into line nextLine of field "Percent"
  125.   end repeat
  126. end rotateData
  127.  
  128.  
  129.  
  130.  
  131. -- part 4 (button)
  132. -- low flags: 00
  133. -- high flags: 8003
  134. -- rect: left=355 top=161 right=194 bottom=388
  135. -- title width / last selected line: 0
  136. -- icon id / first selected line: 0 / 0
  137. -- text alignment: 1
  138. -- font id: 0
  139. -- text size: 12
  140. -- style flags: 0
  141. -- line height: 16
  142. -- part name: 7
  143. ----- HyperTalk script -----
  144. on mouseUp
  145.   repeat with x=3 down to 1
  146.     if char x of field "Difference" is "?" then
  147.       put "7" into char x of field "Difference"
  148.       put x into it
  149.       subtract 1 from it
  150.       if  x>1 then put "?" into char it of field "Difference"
  151.       exit mouseUp
  152.     end if
  153.   end repeat
  154. end mouseUp
  155.  
  156.  
  157.  
  158. -- part 5 (button)
  159. -- low flags: 00
  160. -- high flags: 8003
  161. -- rect: left=395 top=161 right=194 bottom=427
  162. -- title width / last selected line: 0
  163. -- icon id / first selected line: 0 / 0
  164. -- text alignment: 1
  165. -- font id: 0
  166. -- text size: 12
  167. -- style flags: 0
  168. -- line height: 16
  169. -- part name: 8
  170. ----- HyperTalk script -----
  171. on mouseUp
  172.   repeat with x=3 down to 1
  173.     if char x of field "Difference" is "?" then
  174.       put "8" into char x of field "Difference"
  175.       put x into it
  176.       subtract 1 from it
  177.       if  x>1 then put "?" into char it of field "Difference"
  178.       exit mouseUp
  179.     end if
  180.   end repeat
  181. end mouseUp
  182.  
  183.  
  184.  
  185. -- part 6 (button)
  186. -- low flags: 00
  187. -- high flags: 8003
  188. -- rect: left=435 top=162 right=194 bottom=467
  189. -- title width / last selected line: 0
  190. -- icon id / first selected line: 0 / 0
  191. -- text alignment: 1
  192. -- font id: 0
  193. -- text size: 12
  194. -- style flags: 0
  195. -- line height: 16
  196. -- part name: 9
  197. ----- HyperTalk script -----
  198. on mouseUp
  199.   repeat with x=3 down to 1
  200.     if char x of field "Difference" is "?" then
  201.       put "9" into char x of field "Difference"
  202.       put x into it
  203.       subtract 1 from it
  204.       if  x>1 then put "?" into char it of field "Difference"
  205.       exit mouseUp
  206.     end if
  207.   end repeat
  208. end mouseUp
  209.  
  210.  
  211.  
  212. -- part 7 (button)
  213. -- low flags: 00
  214. -- high flags: 8003
  215. -- rect: left=356 top=201 right=233 bottom=389
  216. -- title width / last selected line: 0
  217. -- icon id / first selected line: 0 / 0
  218. -- text alignment: 1
  219. -- font id: 0
  220. -- text size: 12
  221. -- style flags: 0
  222. -- line height: 16
  223. -- part name: 4
  224. ----- HyperTalk script -----
  225. on mouseUp
  226.   repeat with x=3 down to 1
  227.     if char x of field "Difference" is "?" then
  228.       put "4" into char x of field "Difference"
  229.       put x into it
  230.       subtract 1 from it
  231.       if  x>1 then put "?" into char it of field "Difference"
  232.       exit mouseUp
  233.     end if
  234.   end repeat
  235. end mouseUp
  236.  
  237.  
  238.  
  239. -- part 8 (button)
  240. -- low flags: 00
  241. -- high flags: 8003
  242. -- rect: left=395 top=202 right=234 bottom=428
  243. -- title width / last selected line: 0
  244. -- icon id / first selected line: 0 / 0
  245. -- text alignment: 1
  246. -- font id: 0
  247. -- text size: 12
  248. -- style flags: 0
  249. -- line height: 16
  250. -- part name: 5
  251. ----- HyperTalk script -----
  252. on mouseUp
  253.   repeat with x=3 down to 1
  254.     if char x of field "Difference" is "?" then
  255.       put "5" into char x of field "Difference"
  256.       put x into it
  257.       subtract 1 from it
  258.       if  x>1 then put "?" into char it of field "Difference"
  259.       exit mouseUp
  260.     end if
  261.   end repeat
  262. end mouseUp
  263.  
  264.  
  265.  
  266. -- part 9 (button)
  267. -- low flags: 00
  268. -- high flags: 8003
  269. -- rect: left=435 top=201 right=233 bottom=466
  270. -- title width / last selected line: 0
  271. -- icon id / first selected line: 0 / 0
  272. -- text alignment: 1
  273. -- font id: 0
  274. -- text size: 12
  275. -- style flags: 0
  276. -- line height: 16
  277. -- part name: 6
  278. ----- HyperTalk script -----
  279. on mouseUp
  280.   repeat with x=3 down to 1
  281.     if char x of field "Difference" is "?" then
  282.       put "6" into char x of field "Difference"
  283.       put x into it
  284.       subtract 1 from it
  285.       if  x>1 then put "?" into char it of field "Difference"
  286.       exit mouseUp
  287.     end if
  288.   end repeat
  289. end mouseUp
  290.  
  291.  
  292.  
  293. -- part 10 (button)
  294. -- low flags: 00
  295. -- high flags: 8003
  296. -- rect: left=356 top=242 right=274 bottom=389
  297. -- title width / last selected line: 0
  298. -- icon id / first selected line: 0 / 0
  299. -- text alignment: 1
  300. -- font id: 0
  301. -- text size: 12
  302. -- style flags: 0
  303. -- line height: 16
  304. -- part name: 1
  305. ----- HyperTalk script -----
  306. on mouseUp
  307.   repeat with x=3 down to 1
  308.     if char x of field "Difference" is "?" then
  309.       put "1" into char x of field "Difference"
  310.       put x into it
  311.       subtract 1 from it
  312.       if  x>1 then put "?" into char it of field "Difference"
  313.       exit mouseUp
  314.     end if
  315.   end repeat
  316. end mouseUp
  317.  
  318.  
  319.  
  320. -- part 11 (button)
  321. -- low flags: 00
  322. -- high flags: 8003
  323. -- rect: left=395 top=241 right=273 bottom=428
  324. -- title width / last selected line: 0
  325. -- icon id / first selected line: 0 / 0
  326. -- text alignment: 1
  327. -- font id: 0
  328. -- text size: 12
  329. -- style flags: 0
  330. -- line height: 16
  331. -- part name: 2
  332. ----- HyperTalk script -----
  333. on mouseUp
  334.   repeat with x=3 down to 1
  335.     if char x of field "Difference" is "?" then
  336.       put "2" into char x of field "Difference"
  337.       put x into it
  338.       subtract 1 from it
  339.       if  x>1 then put "?" into char it of field "Difference"
  340.       exit mouseUp
  341.     end if
  342.   end repeat
  343. end mouseUp
  344.  
  345.  
  346.  
  347. -- part 12 (button)
  348. -- low flags: 00
  349. -- high flags: 8003
  350. -- rect: left=436 top=242 right=274 bottom=468
  351. -- title width / last selected line: 0
  352. -- icon id / first selected line: 0 / 0
  353. -- text alignment: 1
  354. -- font id: 0
  355. -- text size: 12
  356. -- style flags: 0
  357. -- line height: 16
  358. -- part name: 3
  359. ----- HyperTalk script -----
  360. on mouseUp
  361.   repeat with x=3 down to 1
  362.     if char x of field "Difference" is "?" then
  363.       put "3" into char x of field "Difference"
  364.       put x into it
  365.       subtract 1 from it
  366.       if  x>1 then put "?" into char it of field "Difference"
  367.       exit mouseUp
  368.     end if
  369.   end repeat
  370. end mouseUp
  371.  
  372.  
  373.  
  374. -- part 13 (button)
  375. -- low flags: 00
  376. -- high flags: 8003
  377. -- rect: left=356 top=281 right=313 bottom=408
  378. -- title width / last selected line: 0
  379. -- icon id / first selected line: 0 / 0
  380. -- text alignment: 1
  381. -- font id: 0
  382. -- text size: 12
  383. -- style flags: 0
  384. -- line height: 16
  385. -- part name: 0
  386. ----- HyperTalk script -----
  387. on mouseUp
  388.   repeat with x=3 down to 1
  389.     if char x of field "Difference" is "?" then
  390.       put "0" into char x of field "Difference"
  391.       put x into it
  392.       subtract 1 from it
  393.       if  x>1 then put "?" into char it of field "Difference"
  394.       exit mouseUp
  395.     end if
  396.   end repeat
  397. end mouseUp
  398.  
  399.  
  400.  
  401. -- part 14 (button)
  402. -- low flags: 00
  403. -- high flags: 8003
  404. -- rect: left=414 top=281 right=313 bottom=468
  405. -- title width / last selected line: 0
  406. -- icon id / first selected line: 0 / 0
  407. -- text alignment: 1
  408. -- font id: 0
  409. -- text size: 12
  410. -- style flags: 0
  411. -- line height: 16
  412. -- part name: Enter
  413. ----- HyperTalk script -----
  414. on mouseUp
  415.   global answer
  416.   if field "Flag" > 0 then exit mouseUp
  417.   put field "Minuend" into answer
  418.   subtract field "Subtrahend" from answer
  419.   add 1 to field "Attempts"
  420.   if field "Difference" = answer then
  421.     add 1 to field "Correct"
  422.     get field "Correct"
  423.     divide it by field "Attempts"
  424.     multiply it by 100
  425.     put round(it) into field "Percent"
  426.     celebrate
  427.   else
  428.     get field "Correct"
  429.     divide it by field "Attempts"
  430.     multiply it by 100
  431.     put round(it) into field "Percent"
  432.     nag
  433.   end if
  434. end mouseUp
  435.  
  436. on celebrate
  437.   put "Correct" into line 1 of field "Comment"
  438.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  439.   hide button "Smiley"
  440.   put "1" into field "Flag"
  441.   if first word of bkgnd field "Options" = "Y" then
  442.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  443.   end if
  444. end celebrate
  445.  
  446. on nag
  447.   global answer
  448.   put "WRONG!" into line 1 of field "Comment"
  449.   put "The answer is "& answer & "." into line 2 of field "Comment"
  450.   hide button "Frowney"
  451.   put "2" into field "Flag"
  452.   if first word of bkgnd field "Options" = "Y" then
  453.     play "boing" tempo 200 "gq c e a"
  454.   end if
  455. end nag
  456.  
  457.  
  458.  
  459. -- part contents for background part 2
  460. ----- text -----
  461. O
  462.  
  463. -- part contents for background part 3
  464. ----- text -----
  465. O
  466.  
  467. -- part contents for background part 4
  468. ----- text -----
  469. O
  470.  
  471. -- part contents for background part 5
  472. ----- text -----
  473.    
  474.  
  475. -- part contents for background part 6
  476. ----- text -----
  477.    
  478.  
  479. -- part contents for background part 9
  480. ----- text -----
  481. 1
  482.  
  483. -- part contents for background part 10
  484. ----- text -----
  485. Y 10 6
  486.  
  487. -- part contents for background part 11
  488. ----- text -----
  489. Larry
  490.  
  491. -- part contents for background part 7
  492. ----- text -----
  493.